package br.edu.fanor.esfinge.business.impl;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.EJB;
import javax.ejb.Stateless;

import br.edu.fanor.esfinge.business.AutorSession;
import br.edu.fanor.esfinge.dao.AutorDAO;
import br.edu.fanor.esfinge.entity.Autor;

@Stateless(mappedName="ejb/autorSession")
public class AutorSessionImpl implements AutorSession {

	@EJB
	public AutorDAO autorDAO;
	
	@Override
	public void inserir(Autor autor) {
		autorDAO.inserir(autor);
		
	}
	@PostConstruct
	public void postConstruct() {
		System.out.println("Criou o EJB");
	}
		
	@PreDestroy
	public void preDestroy(){
		System.out.println("Destruiu o EJB");
	}
	
}
